#ifndef DATA_GEN
#define DATA_GEN

#include "main.h"
#include "encoder_functions.h"
#include "gf_types.h"

/* Define data generation modes: fixed error probability, or probability
   per symbol */
#define FIXED_ERR_PROB  0
#define PROB_PER_SYMBOL 1

/* Generate a random message symbol.  Symbol must lie in the field GF(2^m) */
int gen_symbol(int m);

/* Generate a data word and encode it into a data word */
Vector * gen_codeword(int m, int t, Matrix *add_one, Vector *msg, Vector *g); 

/* Add randomized errors to a code word according to input parameters */
Vector * add_error(double e_prob, int e_per_word, double *e_pmf, int m, 
                                                        int mode, Vector *T);

/* Create a data file of length data_length */
int create_data(int     m,
                Matrix  *add_one,
                int     t,
                int     data_length,
                double  e_prob,
                int     e_per_word,
                double  *e_pmf,
                int     mode,
                char    *fname);

#endif
